package lookas.track;

public class Point {

	double lat;
	double lon;

	public double getLat() {
		return lat;
	}

	public double getLon() {
		return lon;
	}

	public Point() {
	}

	public Point(double lat, double lon) {
		this.lat = lat;
		this.lon = lon;
	}

	@Override
	public String toString() {
		return lat + ", " + lon;
	}

	public static double wspolLiniowe(Point p1, Point p2, Point p3) {
		return det(p2, p3) - det(p1, p3) + det(p1, p2);
	}

	private static double det(Point p1, Point p2) {
		double det;
		det = p1.getLat() * p2.getLon() - p2.getLat() * p1.getLon();
		return det;
	}
}
